package com.aopeng.interceptor;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.servlet.http.HttpServletRequest;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
* @Description: 请求拦截器
* @Author: 谢辉
* @CreateDate: 2020/7/18 0:45
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/admin/**")
                .excludePathPatterns("/admin")       //排除此请求，该请求不会被过滤
                .excludePathPatterns("/admin/indexpage")
                .excludePathPatterns("/");
    }
}
